import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vuetify from 'vite-plugin-vuetify'
import { resolve } from 'path' 

export default defineConfig({
    plugins: [
        vue(),
        vuetify({ autoImport: true }), 
    ],
    build: {
        outDir: 'dist',
        rollupOptions: {
            input: {
                main: resolve(__dirname, 'src/popup/index.html'),
                background: resolve(__dirname, 'src/background.js')
            },
            output: {
                entryFileNames: '[name].js',
                chunkFileNames: 'chunks/[name].[hash].js', 
            }
        },
    },
    css: {
        preprocessorOptions: {
            scss: {
                additionalData: `@import "@/styles/variables.scss";`
            }
        }
    },
    resolve: {
        alias: {
            '@': resolve(__dirname, 'src'),
            'vue-router': 'vue-router/dist/vue-router.esm-bundler.js'
        },
    },
})